Originally shared by Elliott HughesAndroid M init improvements.
Android's init gains a long-requested feature in M: there's a new 'exec' command. If you're an OEM and have been using your own implementation, or you've been hacking tons of random crap into init itself (just like Google has for years), please give this a go and let us know whether it works for you. Documentation in system/core/init/readme.txt.
Another interesting change for OEMs (especially if you're seeing "init: could not import file '/init.unknown.rc' from '/init.rc'" in dmesg) is that ro.hardware is now expected to come from device tree under firmware/android/hardware. (You can just set hardware=tardis on your kernel command line, but device tree is the way forward.)
Boot time is becoming a hot topic, especially because no one like to wait while their TV (or car) boots. Bootcharting has been fixed so it works again, and is now always available; it's no longer compiled out. (Bootcharting documentation is in system/core/init/readme.txt too.) We log more to dmesg now explaining where the time is going, mainly to prove that slow boot times aren't init's fault, but also to draw attention to slow areas. One thing we found was that some SoC vendors felt that as long as they came in under the ueventd coldboot timeout of 5s, everything was fine. But taking 5s is insane, and some SoC vendors were trying to
increase it rather than get their act together! In our tree the timeout is now 1s. If relatively weak hardware from a few years ago can do this in 0.2s, so you can you. If you're an OEM, you might want to check that your SoC vendor isn't being lazy. Check for a new "ueventd: Coldboot took 0.21s" line in dmesg.
#androiddev #io15